package com.hmall.search.web;

import com.hmall.common.dto.PageDTO;
import com.hmall.common.dto.SearchParams;
import com.hmall.common.dto.SearchVo;
import com.hmall.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Author lyh
 * @Date 2024/11/13 20:43
 */
@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private SearchService searchService;
    @PostMapping("/filters")
    public SearchVo filters(@RequestBody SearchParams searchParams){
        SearchVo searchVo= searchService.filters(searchParams);
        return searchVo;
    }
    @PostMapping("/list")
    public PageDTO list(@RequestBody SearchParams searchParams){
        PageDTO pageDTO=searchService.list(searchParams);
        return pageDTO;
    }
}
